package com.song.feign.controller;

import com.song.common.entity.R;
import com.song.feign.service.DeptFeign;
import com.song.feign.service.EmpFeign;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author TonySong
 * @date 2024/4/27 0027
 * @time 16:42
 */
@RestController
@RequestMapping("/feign")
public class FeignController {
    @Resource
    private DeptFeign deptFeign;

    @Resource
    private EmpFeign empFeign;


    @GetMapping("/dept")
    public R findAllDept(){
        return new R(200,"ok",true,this.deptFeign.getDept());
    }

    @GetMapping("/")
    public R findAll(){
        return new R(200,"ok",true,this.empFeign.getEmp());
    }
}
